<template>
  <div>
    <el-form label-width="120px" :model="formData">
      <el-form-item label="Id">
        <el-input v-model="formData.id" disabled class="inputid"></el-input>
        <el-button @click="genId">重新生成</el-button>
      </el-form-item>
      <el-form-item label="名称">
        <el-input v-model="formData.name"></el-input>
      </el-form-item>
<!--       <el-form-item>-->
<!--        <el-button type="primary" @click="onSubmit">保存</el-button>-->
<!--      </el-form-item>-->
    </el-form>
  </div>
</template>
<script>
import { getBpmnId } from '../bpmn-adapter/bpmnIds.js';
export default {
  name: '',
  props: {
    nodeData: Object
  },
  mounted() {
    const {  name,id } = this.$props.nodeData

    if (name) {
      this.$data.formData.name = name
    }
    if (id ) {
      this.$data.formData.id = id
    }
  },
  data () {
    return {
      text: '',
      formData: {
          id:'',
          name:'',
          type:'bpmn:process'
        },
    }
  }, 
  methods: {
    save() {
      //const { id } = this.$props.nodeData
      console.log("process")
      this.$emit('updateParent',this.$data.formData)
    },
    genId(){
       this.formData.id='Process_'+getBpmnId()
    }
  }
}
</script>
<style scoped>
.inputid{
  width: 200px;
  margin-right: 10px;
}
</style>
